home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / free_browsing / DavesQckSearchDbar3-14 / dqsd.exe / searches / googletrans.xml < prev    next >
Text File  |  2002-08-30  |  4KB  |  88 lines

  1. <search function="googletrans">
  2.   <name>Google.com Language Translation</name>
  3.   <description>
  4.     Translate text or webpages from one language to another.<br/>
  5.     <a class="helpboxDescLabels">Switches:</a><br />
  6.     <table class="helpboxDescTable">
  7.       <tr><td>/from:en</td><td>/to:de</td><td> - </td><td>English to German</td></tr>
  8.       <tr><td>/from:en</td><td>/to:es</td><td> - </td><td>English to Spanish</td></tr>
  9.       <tr><td>/from:en</td><td>/to:fr</td><td> - </td><td>English to French</td></tr>
  10.       <tr><td>/from:en</td><td>/to:it</td><td> - </td><td>English to Italian</td></tr>
  11.       <tr><td>/from:en</td><td>/to:pt</td><td> - </td><td>English to Portuguese</td></tr>
  12.       <tr><td>/from:de</td><td>/to:en</td><td> - </td><td>German to English</td></tr>
  13.       <tr><td>/from:de</td><td>/to:fr</td><td> - </td><td>German to French</td></tr>
  14.       <tr><td>/from:es</td><td>/to:en</td><td> - </td><td>Spanish to English</td></tr>
  15.       <tr><td>/from:es</td><td>/to:fr</td><td> - </td><td>Spanish to French</td></tr>
  16.       <tr><td>/from:fr</td><td>/to:en</td><td> - </td><td>French to English</td></tr>
  17.       <tr><td>/from:fr</td><td>/to:de</td><td> - </td><td>French to German</td></tr>
  18.       <tr><td>/from:fr</td><td>/to:es</td><td> - </td><td>French to Spanish</td></tr>
  19.       <tr><td>/from:it</td><td>/to:en</td><td> - </td><td>Italian to English</td></tr>
  20.       <tr><td>/from:pt</td><td>/to:en</td><td> - </td><td>Portuguese to English</td></tr>
  21.     </table>
  22.     <div class="helpboxDescLabels">Examples:</div>
  23.     <table class="helpboxDescTable">
  24.       <tr><td>googletrans /from:en /to:es hello how are you</td></tr>
  25.       <tr><td>googletrans /from:en /to:es http://www.whitehouse.gov</td></tr>
  26.     </table>
  27.   </description>
  28.   <category>Reference</category>
  29.   <link>http://www.google.com/language_tools</link>
  30.   <contributor>MLL, inspired by Neel Doshi & Greg Mitchell's freetrans.xml</contributor>
  31.  
  32.   <form name="googletransfTEXT"
  33.     action="http://translate.google.com/translate_t"
  34.     method="post">
  35.     <input type="hidden" name="text" />
  36.     <input type="hidden" name="langpair" />
  37.   </form>
  38.  
  39.  
  40.   <form name="googletransfURL"
  41.     action="http://translate.google.com/translate">
  42.     <input type="hidden" name="u" />
  43.     <input type="hidden" name="langpair" />
  44.   </form>
  45.  
  46.  
  47.   <script><![CDATA[
  48.     function googletrans(q)
  49.     {
  50.       var switch_list = new Array("from", "to");
  51.       var args = parseArgs(q, switch_list);
  52.       if(nullArgs("googletrans", args.q)) return false;
  53.  
  54.       // check if the required switches are set
  55.       for (var j = 0; j < switch_list.length; j++)
  56.       {
  57.         if ( typeof args.switch_val[ switch_list[j] ] == "undefined" || args.switch_val[ switch_list[j] ] == "" )
  58.         {
  59.           nullargs("googletrans", "?");
  60.           return false;
  61.         }
  62.       }
  63.  
  64.       // Determine if the string is a url or not
  65.       var strURL = isURL(args.q);
  66.       if (strURL)
  67.       {
  68.         googletransfURL.u.value = strURL;
  69.         googletransfURL.langpair.value = args.switch_val["from"] + "|" + args.switch_val["to"];
  70.         submitForm(googletransfURL);
  71.       }
  72.       else
  73.       {
  74.         googletransfTEXT.text.value = args.q;
  75.         googletransfTEXT.langpair.value = args.switch_val["from"] + "|" + args.switch_val["to"];
  76.         submitForm(googletransfTEXT);
  77.       }
  78.       return true;
  79.     }
  80.   ]]></script>
  81.  
  82.   <copyright>
  83.     Copyright (c) 2002 David Bau
  84.     Distributed under the terms of the
  85.     GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  86.   </copyright>
  87. </search>
  88.